<%--
  Created by IntelliJ IDEA.
  User: 赵一凡
  Date: 24/5/2024
  Time: 下午 12:06
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>查询结果</title>
</head>
<body>
<h2>查询结果</h2>
<c:if test="${not empty books}">
  <table border="1">
    <tr>
      <th>ID</th>
      <th>商品</th>
      <th>商家</th>
      <th>价格</th>
      <th>销量</th>
      <th>库存</th>
    </tr>
    <c:forEach var="book" items="${books}">
      <tr>
        <td>${book.id}</td>
        <td>${book.name}</td>
        <td>${book.author}</td>
        <td>${book.price}</td>
        <td>${book.sales}</td>
        <td>${book.stock}</td>
      </tr>
    </c:forEach>
  </table>
</c:if>
<c:if test="${empty books}">
  <p>没有找到匹配的商品。</p>
</c:if>
</body>
</html>
